<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <child @pfn="getdata" :mess="msg"></child>
</div>
<script src="vue.js"></script>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            msg: '父类信息'
        },
        methods: {
            getdata(data) {
                this.msg = data
            }
        },
        components: {
            child: {
                props: ['mess'],
                template: `<div>
                  <span>{{mess}}</span>
                  <input type="text"  v-model="name">
                  <button @click="fn"> 子组件</button>
                </div>
               `,
                data() {
                    return {
                        name: ''
                    }
                },
                methods: {
                    fn() {
                        this.$emit('pfn', this.name)
                    }
                }
            }
        }
    })

</script>
</body>
</html>